﻿	      <?php include("conn.php");
             mysql_query('SET NAMES UTF8'); 

	  

class MyPrizeBean
{
	public $title;
	public $price;
	public $images;
	public $name;
	public $goodsid;
	public $number;
	public $gname;
	public $numbers;
	public $classify;
	public $brand;
	public $produce;
	public $state;
	public $zongjia;
	public $sd;
	public $sum;
	public $dizhi;
	public $lijie;

	function __construct($title,$price,$images,$name,$goodsid,$number,$gname,$numbers,$classify,$brand,$produce,$state,$zongjia,$sd,$sum,$dizhi,$lijie)
	{
		$this->title      = $title;
		$this->price = $price;
		$this->images     = $images;
		$this->name      = $name;
		$this->goodsid    = $goodsid;
		$this->number    = $number;
		$this->gname   = $gname;
		$this->numbers    = $numbers;
		$this->classify    = $nclassify;
		$this->brand    = $brand;
		$this->produce   = $produce;
		$this->state    = $state;
		$this->zongjia    = $zongjia;
		$this->sd    = $sd;
		$this->sum    = $sum;
		$this->dizhi    = $dizhi;
		$this->lijie   = $lijie;
	}
}





	$uid=2;
	$sta=$_REQUEST[ordersid];
	
	$prize = array();
		$rert30=mysql_query("select *from goodsorders where ordersid ='".$sta."'");
	
	$rowf=mysql_fetch_array($rert30);
	
	 $rert31=mysql_query("select *from car where ordersid ='".$rowf[ordersid]."'");
$rowf1=mysql_fetch_array($rert31);

$rert34=mysql_query("select SUM(number) as total from car where ordersid ='".$rowf[ordersid]."'");
$rowf4=mysql_fetch_array($rert34);
   
 $rert32=mysql_query("select *from shop where  shopid ='".$rowf[shopid]."'");
$rowf2=mysql_fetch_array($rert32);

$rert33=mysql_query("select *from goods where goodsid ='".$rowf1[goodsid]."'");
$rowf3=mysql_fetch_array($rert33);

	
      if($rowf['state']=="4")
	  { 
	  
	  if($rowf['tuikuan']=="0")
	  {
	  $state="等待商家确认";
	   $lijies="等待商家确认";
	  }
	 else if($rowf['tuikuan']=="1")
	  {
	 
		  $dizhis="<span onClick='addpings()'>确定已经处理完毕</span>";
		  $lijies="商家已经同意你的请求请处理";
	  }
	  else   if($rowf['tuikuan']=="2")
	  {
	  $state="等待商家确认";
	   $lijies="等待商家确认";
	  }
	
	  }
	  else
	  {
	   $lijies="申请售后";
	  $state="<input name='content' type='text' class='chakbut' id='content' placeholder='请描述你的售后理由'>";
	 $dizhis="<span onClick='addping()'> 提交 </span>";
	  }

			$prize[] = new MyPrizeBean($rowf3['title'],$rowf3['price'],$rowf3['images'],$rowf2['name'],$rowfs['goodsid'],$rowf1['number'],$rowf3['name'],$rowf1['numbers'],$rowf3['nclassify'],$rowf3['brand'],$rowf3['produce'],$state,$rowf['totalprice'],$sds,$rowf4[total],$dizhis,$lijies);
		
	

echo json_encode($prize);


?>